<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">

        /*包装类*/
        // var str = 'abc';
        // str += 1;
        // var test = typeof(str);
        // if(test.length == 6) {
        //     test.sign = "typeof的返回结果可能为String";
        // }
        // console.log(test.sign);




        /*对象，闭包*/

        function Person(name, age, sex) {
            var a = 0;
            this.name = name;
            this.age = age;
            this.sex = sex;
            function sss() {
                a ++;
                console.log(a);
            }
            this.say = sss;
        } 
        var oPerson = new Person();
        oPerson.say();
        oPerson.say(); 
        var oPerson1 = new Person();  
        oPerson1.say();





        // var x = 1, y = z = 0;

        // function add(n) {
        //     return n = n + 1;
        // }
        // y = add(x);

        // function add(n) {
        //     return n = n + 3;
        // }
        // z = add(x);

        // console.log(x, y, z);
    </script>
</body>

</html>